@echo off

echo =================================================================
echo Build Start
echo =================================================================
for /D %%a in ( "*" ) do call :Build %%a


:Build
if "%1" == "" goto :EOF
echo =================================================================
echo android.bat update project --subprojects --target android-8 --name %1 --path %1
echo =================================================================
call android.bat update project --subprojects --target android-8 --name %1 --path %1


echo =================================================================
echo ant debug -buildfile %1
echo =================================================================
call ant debug -buildfile %1

if exist %1\\bin\\%1-debug.apk goto CopyFile
    goto :EOF

goto :EOF

:CopyFile
echo =================================================================
echo mv file %1/bin/%1-debug.apk
echo =================================================================
call mv %1/bin/%1-debug.apk ../bin